import Vue from 'vue'
import Router from 'vue-router'
import admin from '../views/admin/admin'
import 'element-ui/lib/theme-chalk/index.css'
import test1 from '../views/test/test1'
import test2 from '../views/test/test2'
import index from '../views/index/index'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      // component: index
      redirect:'/admin/index'
    },
    {
      path:'/admin',
      component:admin,
      name:'admin',
      children:[
        {
          path:'/',
          name:'index',
          redirect:'index',
          meta:{
            title:'主页'
          }
        },
        {
          path:'index',
          name:'index',
          component:index,
          meta:{
            title:'主页'
          }
        },
        {
          path:'test1',
          name:'test1',
          component:test1,
          meta:{
            title:'选项一'
          }
        },
        {
          path:'test2',
          name:'test2',
          component:test2,
          meta:{
            title:'选项二'
          }
        }
      ]
    }
  ]
})
